package com.csp.app.controller.page;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

@Controller
public class PageController {
    @RequestMapping("/")
    public String index(HttpSession session) {
        Object user = session.getAttribute("user");
        if (user == null) {
            return "login";
        }
        return "index";
    }

    @RequestMapping("/page/login")
    public String login(HttpSession session) {
        Object user = session.getAttribute("user");
        if (user == null) {
            return "login";
        }
        return "index";
    }

    @RequestMapping("/page/register")
    public String register() {
        return "register";
    }

    @RequestMapping("/page/listFriend")
    public String listFriend() {
        return "listFriend";
    }

}
